import { defineConfig } from "vite";
import react from "@vitejs/plugin-react-swc";

// https://vite.dev/config/
export default defineConfig({
	plugins: [react()],
	server: {
		host: "0.0.0.0",
	},
	css: {
		modules: {
			scopeBehaviour: "local", // 启用 CSS Modules
			generateScopedName: "[name]__[local]___[hash:base64:5]", // 可选：自定义生成类名的格式
			localsConvention: "camelCase", // 可选：将类名转换为驼峰格式
		},
		preprocessorOptions: {
			scss: {
				// additionalData: `@import "src/styles/variables.scss";`,
			},
		},
	},
	resolve: {
		extensions: [".js", ".jsx", ".ts", ".tsx", ".json"],
		alias: {
			"@": "/src",
		},
	},
});
